<div class="welcome-wrapper">
    欢迎您
    <%=userInfo.name%> 登陆
        <h3>您的年龄是 <span><%=userInfo.age%></span></h3>
        <h4>您是第 <span class="num"></span> 次访问我们的网站</h4>
</div>

<script>
    (function(window, document, $, undefined) {
        let num = localStorage.getItem('n') || 1
        $('.welcome-wrapper h4 .num').html(num);
        localStorage.setItem('n', ++num);
    })(window, document, jQuery)
</script>